// 获取累加的值
function sum() {
  return [...arguments].reduce((curr, sum) => curr+sum, 0)
}

// 获取累乘的值
function multiple() {
  return [...arguments].reduce((curr, sum) => curr*sum, 1)
}

// 找到最大值的下标
function findMax(arr) {
  let idx = 0
  return arr.reduce(( undefined, next, index) => {
    if (next > arr[idx]) { 
      max = arr[index]
      idx = index
    }
    return idx
  }, 0)
}